package com.xaiojimao.gr_common.exception;

import com.xaiojimao.gr_common.CommonEnum.BizCommonEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class CommonException extends RuntimeException {

    private Integer errorCode;

    private String errorMsg;

    public static CommonException DefultCommonException(BizCommonEnum bizCommonEnum) {
        return new CommonException(bizCommonEnum.getCode(), bizCommonEnum.getMsg());
    }
}
